package com.pai4j.common.enums;
import com.pai4j.common.exception.BusinessException;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum SubjectRelationTypeEnum {


    
    USER_SUBSCRIBE_SUBJECT(0, "订阅专题"),
    ;

    private Integer type;
    private String typeName;

    public static SubjectRelationTypeEnum getByTargetAccountRoleCode(int roleCode) {
        switch (roleCode) {
            case 7:
                return SubjectRelationTypeEnum.USER_SUBSCRIBE_SUBJECT;

        }
        log.error("不支持的关系类型 =====> roleCode: {}", roleCode);
        throw new BusinessException("不支持的关系类型");
    }
}
